package net.starwifi.duobao.web;

import net.starwifi.duobao.dto.OMember;
import net.starwifi.duobao.entity.Member;
import net.starwifi.duobao.mvc.BaseController;
import net.starwifi.duobao.mvc.Message;
import net.starwifi.duobao.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

/**
 * Created by Administrator on 2015/10/30.
 */
@Controller("OMemberController")
@RequestMapping(value = "/oMember")
public class OMemberController extends BaseController {


    @Autowired
    MemberService memberService;

    /**
     * 扫描后-其他用户信息
     */
    @ResponseBody
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    public  Object info(HttpServletRequest request,Long id) {
        final Member member=memberService.find(id);
        return Message.createMessage(Message.success("成功"), new HashMap<String, Object>() {{
            put("entity", OMember.get(member));
        }});
    }


}
